package com.dora.pattern.strategy.classic;

import com.dora.pattern.strategy.Stock;

import java.util.List;

/**
 * 上下文
 *
 * @author hanchen
 * @date 2024/03/14
 */
public class Context {
    private Strategy strategy;

    public void setStrategy(Strategy strategy) {
        this.strategy = strategy;
    }

    public List<Stock> getRank(List<Stock> source) {
        return strategy.sort(source);
    }
}
